import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";


type homeResult = {
  page: any;
  result: any
};

/** 新增经销商 */
export const addXdealerController = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/xdealerController/insert"), { data });
};

/** 根据id删除经销商 */
export const deleteXdealerController = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/xdealerController/delete/${userid}`));
};


/** 修改经销商信息 */
export const updateXdealerController = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/xdealerController/update"), { data });
};


/** 分页查询 */
export const getXdealerController = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/xdealerController/selbypage"), { data });
};
